/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jili.ubert.code;

import com.baidu.bjf.remoting.protobuf.EnumReadable;

/**
 *
 * @author CHengJILI
 */
public enum OrderBS implements EnumReadable {
    B(1) { public String getCode() {return "B";} public String getName() {return "买入"; }},
    S(2) { public String getCode() {return "S";} public String getName() {return "卖出"; }},
    D(3) { public String getCode() {return "D";} public String getName() {return "分红"; }},
    E(4) { public String getCode() {return "E";} public String getName() {return "行权"; }},
    O(5) { public String getCode() {return "O";} public String getName() {return "撤单"; }},
    UNKONW(7) { public String getCode() {return "U";} public String getName() {return "未知"; }},
    C(6) { public String getCode() {return "C";} public String getName() {return "履约"; }};

    public abstract String getName();
    public abstract String getCode();
    private final int value;
    OrderBS(int value) { this.value = value; }
    public static OrderBS DeCode(String code) { 
        switch (code){
            case "B":{return OrderBS.B;}
            case "S":{return OrderBS.S;}
            case "D":{return OrderBS.D;}
            case "E":{return OrderBS.E;}
            case "O":{return OrderBS.O;}
            case "C":{return OrderBS.C;}
            default :{return OrderBS.UNKONW;}
        }
    }
    public int value() { return this.value; }
}
